package siyuan.run.logger.feignclient;

import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import siyuan.run.logger.config.FeignConfiguration;
import siyuan.run.logger.model.User;

import java.util.Map;

/**
 * @program: sy
 * @description:
 * @author: Jacob
 * @create: 2020-11-24 22:42
 **/
@FeignClient(contextId = "feignClient", name = "service-provider", configuration = FeignConfiguration.class)
public interface MyFeignClient {

    @GetMapping("/hello")
    public String hello();

    @GetMapping("get1")
    String get1(@RequestParam("id") int id, @RequestParam("name") String name);

    @GetMapping("get2")
    Map<String, Object> get2(@RequestParam("map") Map<String, Object> map);

    @PostMapping("post1")
    User post1(@RequestBody User user);
}
